package edu.gatech.volt2.drdoommgt.gui;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

@SuppressWarnings("serial")
public class NurseWindow extends JFrame implements INurseView{

	private JPanel contentPane;

	private JButton createPatientButton;
	private JButton deletePatientButton;
	private JButton editPatientButton;
	private JButton viewPatientButton;
	private JButton searchPatientButton;
	private JButton treatmentButton;
	private JButton apptPageButton;
	private JButton exitButton;
	private JButton btnCreateInvoice;
	
	/**
	 * Create the frame.
	 */
	public NurseWindow() {
		setResizable(false);
		setTitle("Dr. Doom Management");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(5, 5, 439, 267);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JLabel optionLabel = new JLabel("What would you like to do?");
		optionLabel.setHorizontalAlignment(SwingConstants.CENTER);
		optionLabel.setBounds(131, 10, 177, 29);
		panel.add(optionLabel);
		
		createPatientButton = new JButton("Create a Patient");
		createPatientButton.setBounds(10, 51, 195, 30);
		panel.add(createPatientButton);
		
		deletePatientButton = new JButton("Delete a Patient");
		deletePatientButton.setBounds(10, 92, 195, 30);
		panel.add(deletePatientButton);
		
		editPatientButton = new JButton("Edit a Patient");
		editPatientButton.setBounds(10, 133, 195, 30);
		panel.add(editPatientButton);
		
		viewPatientButton = new JButton("View Patients");
		viewPatientButton.setBounds(10, 174, 195, 30);
		panel.add(viewPatientButton);
		
		searchPatientButton = new JButton("Search Patient by Name");
		searchPatientButton.setBounds(238, 52, 195, 30);
		panel.add(searchPatientButton);
		
		treatmentButton = new JButton("Create a Treatment Record");
		treatmentButton.setBounds(238, 92, 195, 30);
		panel.add(treatmentButton);
		
		apptPageButton = new JButton("View Daily Appointment Page");
		apptPageButton.setBounds(238, 133, 195, 30);
		panel.add(apptPageButton);
		
		exitButton = new JButton("Logout");
		exitButton.setBounds(363, 238, 70, 23);
		panel.add(exitButton);
		
		btnCreateInvoice = new JButton("Create Invoice");
		btnCreateInvoice.setBounds(238, 175, 195, 29);
		panel.add(btnCreateInvoice);
	}
	
	
	/**
	 * @return the editPatientButton
	 */
	public JButton getEditPatientButton() {
		return editPatientButton;
	}


	/**
	 * @return the createPatientButton
	 */
	public JButton getCreatePatientButton() {
		return createPatientButton;
	}


	/**
	 * @return the deletePatientButton
	 */
	public JButton getDeletePatientButton() {
		return deletePatientButton;
	}


	/**
	 * @return the viewPatientButton
	 */
	public JButton getViewPatientButton() {
		return viewPatientButton;
	}


	/**
	 * @return the searchPatientButton
	 */
	public JButton getSearchPatientButton() {
		return searchPatientButton;
	}


	/**
	 * @return the treatmentButton
	 */
	public JButton getTreatmentButton() {
		return treatmentButton;
	}

	
	/**
	 * @return the exitButton
	 */
	public JButton getAppointmentButton() {
		return apptPageButton;
	}

	/**
	 * @return the exitButton
	 */
	public JButton getExitButton() {
		return exitButton;
	}


	public void addListener(ActionListener al) {
		createPatientButton.addActionListener(al);
		deletePatientButton.addActionListener(al);
		editPatientButton.addActionListener(al);
		viewPatientButton.addActionListener(al);
		searchPatientButton.addActionListener(al);
		treatmentButton.addActionListener(al);
		apptPageButton.addActionListener(al);
		exitButton.addActionListener(al);
		btnCreateInvoice.addActionListener(al);
	}

	public void showSelf(){
		this.setVisible(true);
	}
	
	public void hideSelf(){
		this.setVisible(false);
	}


	@Override
	public JButton getInvoiceButton() {
		return this.btnCreateInvoice;
	}

}
